﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Top_Meeting.Window;
using TopVisionVideoStream;

namespace Top_Meeting
{
    public partial class TestDisplay : Form
    {
        public TestDisplay()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            TVVS.SetScreen((int)panel1.Handle, (int)panel2.Handle);

            TVVS.VideoCall(Configuration.CallingID, CallType.Video, Result);

            button1.Click += Button1_Click; ;
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            Frm_Main.instance.ConferenceDisplay();
            TopLevel = false;
            Parent = Frm_Main.instance.layPanel_Display;
            WindowState = FormWindowState.Maximized;
        }

        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            TVVS.VideoCallCancel(null);
        }

        private void Result(CallStatusType e)
        {
            switch (e)
            {
                case CallStatusType.Failed:
                    break;
                case CallStatusType.Checking:
                    break;
                case CallStatusType.None:
                    break;
                case CallStatusType.Offline:
                    break;
                case CallStatusType.Online:
                    break;
                case CallStatusType.Calling:
                    break;
                case CallStatusType.Connected:
                    break;
                case CallStatusType.Busy:
                    break;
                case CallStatusType.DisConnect:
                    break;
                case CallStatusType.NoAnswer:
                    break;
                case CallStatusType.StartCalling:
                    break;
                case CallStatusType.Hangup:
                    break;
                default:
                    break;
            }
        }
    }
}
